package com.zfy.tingshu.user.client;

import com.zfy.tingshu.common.result.Result;
import com.zfy.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import com.zfy.tingshu.vo.album.AlbumTrackListVo;
import com.zfy.tingshu.vo.user.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * 
 */
@FeignClient(value = "service-user", fallback = UserInfoDegradeFeignClient.class)
public interface UserInfoFeignClient {
    /**
     * 根据userId 获取到用户信息
     * @param user_id
     * @return
     */
    @GetMapping("/api/user/userInfo/getUserInfo/{user_id}")
    public Result<UserInfoVo> getUserInfo(@PathVariable("user_id") Long user_id);

    /**
     * 判断用户是否购买过声音列表
     * @param albumId
     * @param trackListVos
     * @return
     */
    @PostMapping("api/user/userInfo/userIsPaidTrack/{albumId}")
    Result<Map<Long, Integer>> userIsPaidTrack(@PathVariable("albumId") Long albumId, List<AlbumTrackListVo> trackListVos);
}